package br.com.sgc.session;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import br.com.sgc.dao.FornecedorDao;
import br.com.sgc.entities.produto.Fornecedor;
import br.com.sgc.enuns.TipoOrdenacao;

@Stateless
public class FornecedorSession extends GenericSession<Fornecedor> {

	private static final long serialVersionUID = 8916372154648801284L;
	
	@EJB private FornecedorDao dao;

	public Fornecedor findByCnpj(String cnpj, Long clinicaId) {
		return dao.findByCnpj(cnpj, clinicaId);
	}
	
	@Override
	public List<Fornecedor> findAll(Fornecedor modelClass, Long clinicaId, Integer startPage,
			Integer maxPage, String orderField, Boolean initializeDependecies) {
		return dao.findAll(modelClass, clinicaId, startPage, maxPage, orderField, initializeDependecies);
	}
	
	public List<Fornecedor> findAll(Fornecedor modelClass, Long clinicaId, Integer startPage, Integer maxPage, String orderField, Boolean initializeDependecies, TipoOrdenacao tipoOrdenacao){
		return dao.findAll(modelClass, clinicaId, startPage, maxPage, orderField, initializeDependecies, tipoOrdenacao);
	} 
	
	@Override
	public Long count(Fornecedor modelClass, Long clinicaId){
		return dao.count(modelClass, clinicaId);
	}
	

}
